unit DemoMain_U;
{$I acroMultiLang.inc}
interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ComCtrls, ToolWin, Menus,DBGrids,
  StdCtrls, DBTables, AcroMultiDD, ExtCtrls,
  AcroMultiDDReader,acroMultiLib_vcl,
  AcroMultiDBDDReader,AcroMultiClassMethod,
  acroCulture_Unicode,
  AppEvnts, Grids, Buttons, AcroMultiDBDD, ImgList,
  StdActns, ActnList, AcroMultiReplacer,
  AcroMultiUtils,  ActnMan,
  PlatformDefaultStyleActnCtrls,
  AcroMultiScreen, System.Actions;

type
  TFormMain = class(TForm)
    StatusBar1: TStatusBar;
    TreeView1: TTreeView;
    ImageList1: TImageList;
    ActionList1: TActionList;
    Action_NewSubNode: TAction;
    Action_ViewDB: TAction;
    Action_Open: TAction;
    Action_Save: TAction;
    Action_Locate: TAction;
    EditCut1: TEditCut;
    EditCopy1: TEditCopy;
    EditPaste1: TEditPaste;
    EditUndo1: TEditUndo;
    Action_NewNode: TAction;
    Action_HelpIndex: TAction;
    Action_GB: TAction;
    Action_Big5: TAction;
    Action_Exit: TAction;
    Action_Find: TAction;
    Action_NewLang: TAction;
    Action_DeleteNode: TAction;
    Action_SaveAs: TAction;
    WindowCascade1: TWindowCascade;
    WindowTileHorizontal1: TWindowTileHorizontal;
    WindowTileVertical1: TWindowTileVertical;
    WindowMinimizeAll1: TWindowMinimizeAll;
    WindowArrange1: TWindowArrange;
    Action_NewDD: TAction;
    Action_DeleteLang: TAction;
    Action_ViewDictionary: TAction;
    Action_ViewEdit: TAction;
    Action_ViewSearch: TAction;
    Action_ViewMenu: TAction;
    Action_EditorDialog: TAction;
    Action_EditorSimple: TAction;
    Action_EditorPanel: TAction;
    Action_ImmediateEdit: TAction;
    Action_DeleteSequence: TAction;
    Action_NewSequence: TAction;
    Action_ShowEditorGrid: TAction;
    Action_Export: TAction;
    Action_ExportNode: TAction;
    Action_Import: TAction;
    Action_OpenDB: TAction;
    Action_ImportDB: TAction;
    Action_SaveDB: TAction;
    Action_About: TAction;
    Action_Min: TAction;
    Action_Restore: TAction;
    Action_Close: TAction;
    Action_FindNext: TAction;
    Action_HelpContent: TAction;
    Action_Font: TAction;
    CoolBar_Main: TCoolBar;
    ToolBar_Search: TToolBar;
    Edit_DDValue: TEdit;
    ToolButton26: TToolButton;
    ToolButton27: TToolButton;
    ToolButton31: TToolButton;
    ToolButton8: TToolButton;
    ToolBar_MDI: TToolBar;
    ToolButton9: TToolButton;
    ToolButton10: TToolButton;
    ToolButton11: TToolButton;
    ToolBar_Menu: TToolBar;
    ToolBar_Edit: TToolBar;
    ToolButton12: TToolButton;
    ToolButton13: TToolButton;
    ToolButton14: TToolButton;
    ToolButton16: TToolButton;
    ToolButton17: TToolButton;
    ToolButton18: TToolButton;
    ToolButton19: TToolButton;
    ToolButton20: TToolButton;
    ToolButton15: TToolButton;
    ToolButton21: TToolButton;
    ToolButton22: TToolButton;
    ToolButton23: TToolButton;
    ToolButton24: TToolButton;
    ToolBar_Dictionary: TToolBar;
    ToolButton25: TToolButton;
    ToolButton28: TToolButton;
    ToolButton29: TToolButton;
    ToolButton30: TToolButton;
    ToolButton32: TToolButton;
    ToolButton33: TToolButton;
    ToolButton34: TToolButton;
    ToolBar_DB: TToolBar;
    ToolButton35: TToolButton;
    ToolButton36: TToolButton;
    ToolButton37: TToolButton;
    ToolButton38: TToolButton;
    MainMenu2: TMainMenu;
    MenuItem1: TMenuItem;
    NewDD1: TMenuItem;
    Open1: TMenuItem;
    Import1: TMenuItem;
    N10: TMenuItem;
    Save1: TMenuItem;
    SaveAs1: TMenuItem;
    N13: TMenuItem;
    Export1: TMenuItem;
    ExportNode2: TMenuItem;
    N1: TMenuItem;
    exit1: TMenuItem;
    MenuItem2: TMenuItem;
    Undo1: TMenuItem;
    N3: TMenuItem;
    Cut1: TMenuItem;
    Copy1: TMenuItem;
    Paste1: TMenuItem;
    Search1: TMenuItem;
    Find2: TMenuItem;
    FindNext1: TMenuItem;
    N14: TMenuItem;
    Find1: TMenuItem;
    View1: TMenuItem;
    oolBarMenu1: TMenuItem;
    oolBarDictionary1: TMenuItem;
    oolBarEdit1: TMenuItem;
    oolBarDataBase1: TMenuItem;
    oolBarSearch1: TMenuItem;
    N6: TMenuItem;
    Dialog1: TMenuItem;
    Simple1: TMenuItem;
    Panel1: TMenuItem;
    N7: TMenuItem;
    EditorShowGrid1: TMenuItem;
    ImmediateEdit1: TMenuItem;
    DataBase1: TMenuItem;
    OpenfromDB1: TMenuItem;
    ImportfromDB1: TMenuItem;
    N12: TMenuItem;
    SaveToDB1: TMenuItem;
    Dictionary1: TMenuItem;
    NewKey1: TMenuItem;
    NewSubKey2: TMenuItem;
    DeleteKey1: TMenuItem;
    N4: TMenuItem;
    oGB1: TMenuItem;
    oBig51: TMenuItem;
    N8: TMenuItem;
    AddNewLanguage1: TMenuItem;
    Option1: TMenuItem;
    Menu_Font: TMenuItem;
    Windows1: TMenuItem;
    ileHorizontally1: TMenuItem;
    ileVertically1: TMenuItem;
    Arrange1: TMenuItem;
    Cascade1: TMenuItem;
    MinimizeAll1: TMenuItem;
    MenuItem3: TMenuItem;
    Content1: TMenuItem;
    Index1: TMenuItem;
    N2: TMenuItem;
    About1: TMenuItem;
    ApplicationEvents1: TApplicationEvents;
    ToolButton1: TToolButton;
    procedure Action_NewDDExecute(Sender: TObject);
    procedure Action_ExportExecute(Sender: TObject);
    procedure Action_MinExecute(Sender: TObject);
    procedure Action_RestoreExecute(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
    procedure ApplicationEvents1Idle(Sender: TObject; var Done: Boolean);
    procedure Action_CloseExecute(Sender: TObject);
    procedure Action_OpenExecute(Sender: TObject);
    procedure ToolButton21Click(Sender: TObject);
    procedure ToolButton22Click(Sender: TObject);
    procedure ToolButton1Click(Sender: TObject);
    procedure Action_NewNodeExecute(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    constructor Create(AOwner:TComponent);override;
    destructor Destroy;override;
    procedure Loaded;override;
  end;

var
  FormMain: TFormMain;

implementation

uses MultiDemo_U, DemoDM_U, HashView_U, FormRadioGroup_U;

{$R *.dfm}

type
  TTempMultiDD=class(TCustomMultiDD);
  TComponent_Temp=class(TComponent);

procedure TFormMain.Loaded;
begin
  inherited;
end;

procedure TFormMain.ToolButton1Click(Sender: TObject);
begin
  AcroMultiScreen.ScreenStorage.DefaultReplaceOption.SystemCulture:=false;
  AcroMultiScreen.ScreenStorage.DefaultReplaceOption.LCID:=LCID_ENG;
  ScreenStorage.ReplaceScreen;
  {AcroMultiReplacer1.OwnerOption.SystemCodePage:=false;
  AcroMultiReplacer1.OwnerOption.CodePage:='1252';
  AcroMultiReplacer1.Replace;}
end;

procedure TFormMain.ToolButton21Click(Sender: TObject);
begin
  AcroMultiScreen.ScreenStorage.DefaultReplaceOption.SystemCulture:=false;
  AcroMultiScreen.ScreenStorage.DefaultReplaceOption.LCID:=LCID_CHS;
  ScreenStorage.ReplaceScreen;
  Self.Font.Charset:=AcroMultiUtils.GetFontCharSet(936);
  {AcroMultiReplacer1.OwnerOption.SystemCodePage:=false;
  AcroMultiReplacer1.OwnerOption.CodePage:='936';
  AcroMultiReplacer1.Replace;}
end;

procedure TFormMain.ToolButton22Click(Sender: TObject);
begin
  AcroMultiScreen.ScreenStorage.DefaultReplaceOption.SystemCulture:=false;
  AcroMultiScreen.ScreenStorage.DefaultReplaceOption.LCID:=LCID_CHT;
  ScreenStorage.ReplaceScreen;
  Self.Font.Charset:=AcroMultiUtils.GetFontCharSet(950);
  {AcroMultiReplacer1.OwnerOption.SystemCodePage:=false;
  AcroMultiReplacer1.OwnerOption.CodePage:='950';
  AcroMultiReplacer1.Replace;}
end;

procedure TFormMain.Action_NewDDExecute(Sender: TObject);
begin
  TFormStudent.Create(Application);
end;

procedure TFormMain.Action_ExportExecute(Sender: TObject);
begin
  DumpClassMethodToTree(TreeView1);
end;

procedure TFormMain.Action_MinExecute(Sender: TObject);
var
  F:TCustomForm;
begin
  F:=TCustomForm(ActiveMDIChild);
  if F<>nil then F.WindowState:=wsMinimized;
end;

procedure TFormMain.Action_RestoreExecute(Sender: TObject);
var
  F:TCustomForm;
begin
  F:=TCustomForm(ActiveMDIChild);
  if F<>nil then F.WindowState:=wsNormal;
end;

procedure TFormMain.FormCreate(Sender: TObject);
begin
  Application.Title:=MultiDM.AcroMultiStreamDD_GUI.GetDisplayValue(Application.Title,InttoStr(GetACP),'0');
end;

procedure TFormMain.FormShow(Sender: TObject);
var
  i:integer;
begin
  for i:=0 to CoolBar_Main.Bands.Count-1 do
    CoolBar_Main.Bands[i].MinWidth:=CoolBar_Main.Bands[i].Control.Width;
  ToolBar_MDI.Left:=Screen.Width;
end;

procedure TFormMain.ApplicationEvents1Idle(Sender: TObject;
  var Done: Boolean);
var
  F:TCustomForm;
begin
  F:=ActiveMDIChild;
  Action_Min.Enabled:=(F<>nil) and (F.WindowState=wsMaximized);
  Action_Restore.Enabled:=Action_Min.Enabled;
  Action_Close.Enabled:=Action_Min.Enabled;
end;

procedure TFormMain.Action_CloseExecute(Sender: TObject);
var
  F:TCustomForm;
begin
  F:=ActiveMDIChild;
  if F<>nil then F.Close;
end;

constructor TFormMain.Create(AOwner: TComponent);
begin
  inherited;
end;

destructor TFormMain.Destroy;
begin
  inherited;
end;

procedure TFormMain.Action_OpenExecute(Sender: TObject);
begin
  FormHashView:=TFormHashView.Create(nil);
end;

procedure TFormMain.Action_NewNodeExecute(Sender: TObject);
begin
  TFormRadioGroup.Create(Application);
end;

end.
